//
//  ViewController.swift
//  imageCarouselView
//
//  Created by day-day-Smile on 2018/5/30.
//  Copyright © 2018年 SmileHg. All rights reserved.
//

import UIKit

private let SCREEN_WIDTH = UIScreen.main.bounds.size.width
private let SCREEN_HEIGHT = UIScreen.main.bounds.size.height

class ViewController: UIViewController {
    
    var urls:[Any] = []

    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.loadData()
        
        let loopView = HGLoopView(url: urls)
        loopView.frame = CGRect.init(x: 20, y: 20, width:SCREEN_WIDTH - 40   , height: 350)
        self.view.addSubview(loopView)
        
        
    }
    
    func loadData() {
        
        for i in 0..<4 {
            let fileName = String(format: "%02zd.jpg", i + 1)
            
            if let imgStr = Bundle.main.url(forResource: fileName, withExtension: nil) {
                print("图片数量\(imgStr)")
                urls.append(imgStr)
            }
        }
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

